<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: kent
  Date: 2020/6/13
  Time: 15:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE html>
<html>

<head>
    <base href="<%=basePath%>">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="">
    <title>众筹中原-提供您身边的万元股权投资项目</title>
    <link rel="stylesheet" href="../../../css/public.css" />
    <link rel="stylesheet" href="../../../css/index.css" />
    <script type="text/javascript" src="../../../js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../../../js/jquery.SuperSlide.2.1.1.js"></script>
</head>

<body>
<!-- 头部 -->
<header>
    <div class="center clearfix">
        <div class="rt_head">
					<span>
						<img src="../../../images/head_call.png" alt=""> 官方咨询电话：
						<b>400-999-8235</b>
					</span>
            <span>
						<img src="../../../images/head_scan.png" />微信公众号
					</span>
            <span>
						<a href="/pages/aboutUs">
							关于我们
						</a>
					</span>
        </div>
    </div>
</header>
<!-- 导航nav -->
<nav>
    <div class="center" style="position: relative;">
        <a href="###" class="logo"></a>
        <div class="nav_tab">
            <a href="###">首页</a>
            <a href="/item/showItem">展示类项目</a>
            <a href="/pages/tradeItem">交易类项目</a>
            <a href="/pages/succeedItem">已成功项目</a>
            <a href="/pages/community">众筹社区</a>
        </div>
        <a href="###" class="gradient add_zc">
            +发起众筹
        </a>
        <div class="log_txt">
            <a href="/pages/login">登录</a>|
            <a href="/pages/register">注册</a>
        </div>
    </div>
</nav>
<!--间隔-->
<div class="nuk"></div>
<!-- 头图 -->
<div class="banner_pic_list1"></div>
<!-- 切换 -->
<div class="w_num bg_f6">
    <div class="w_main pro_px">
        <span>项目排序：</span>
        <a href="###" class="active">默认</a>
        <a href="###">即将结束</a>
        <a href="###">最新上线</a>
        <a href="###">预约最多</a>
    </div>
</div>
<!--项目列表-->
<div id="itemsList" class="center">
    <%-- 循环输出项目列表 --%>
    <c:forEach var="item" items="${itemList}">
        <%--把项目id传入get请求，来展示项目详情--%>
    <a href="/item/showItemDetil/?id=${item.id}" class="lj_shop">
        <div class="pro_panel">
            <%-- 列表背景图片,覆盖了shop_img的background样式 --%>
            <div class="shop_img" style="background: url(${item.listImg}) no-repeat center;"></div>
            <div class="shop_cont">
                <div class="shop_box">
                    <h1>${item.title}</h1>
                    <h6>${item.brief}</h6>
                    <h5>
                        <span><i class="iconfont icon-icon-test7"></i>${item.doLike}</span>
                        <span><i class="iconfont icon-liulan"></i>浏览：${item.views}</span>
                        <%--项目时间--%>
                        <span>${item.beginTime} 至 ${item.endTime}</span>
                    </h5>
                    <ul>
                        <li>
                            <%--超过1W的时候改用万单位--%>
                            <p>
                            <c:if test="${item.targetAmount>=10000}">${item.targetAmount/10000}万</c:if>
                            <c:if test="${item.targetAmount<10000}">${item.targetAmount}</c:if>
                            </p>
                            <span>目标金额</span>
                        </li>
                        <li>
                            <p>
                                <c:if test="${item.actAmount>=10000}">${item.actAmount/10000}万</c:if>
                                <c:if test="${item.actAmount<10000}">${item.actAmount}</c:if>
                            </p>
                            <span>支持金额</span>
                        </li>
                        <input type="hidden" class="fStarttime" value="${item.endTime}"/>
                        <li>
                            <c:if test="${item.endDays >=0}">
                                <p>${item.endDays}天</p>
                            </c:if>
                            <c:if test="${item.endDays <0}">
                                <p>项目已结束</p>
                            </c:if>
                            <span>剩余时间</span>
                        </li>
                        <li>
                            <p class="tip">${item.actAmount/item.targetAmount*100}%</p>
                            <span>支持进度</span>
                        </li>
                    </ul>
                    <div class="p_six">
                        <em> <b style="width:${item.actAmount/item.targetAmount*100}%;max-width:100%;" class="gradient"></b></em>
                        <span style="position:absolute;">${item.actAmount/item.targetAmount*100}%</span>
                    </div>
                </div>
            </div>
            <div class="tip_right">
                <img src="../../../images/zsz_right.png" />
            </div>
        </div>
    </a>
    </c:forEach>
</div>
<%--下滑添加--%>
<div id="addItems" class="more_add"></div>
<div class="more_add" >
    <i class="iconfont icon-xiangxiajiantou"></i>
</div>
<!-- footer -->
<footer>
    <div class="w clearfix">
        <div class="lg_footer clearfix">
            <div class="sm_footer">
                <div class="gplz">
                    <div class="gplz_lj">
                        <ul class="" style="">
                            <li>
                                <a href="/pages/aboutUs">关于我们</a>
                            </li>
                            <li> |</li>
                            <li>
                                <a href="/pages/aboutUs">联系我们</a>
                            </li>
                            <li> |</li>
                            <li>
                                <a href="http://www.zczyw.com/help/index/id/7">众筹课堂</a>
                            </li>
                            <li> |</li>
                            <li>
                                <a href="http://www.zczyw.com/help/index/id/3">注册协议</a>
                            </li>
                            <li> |</li>
                            <li>
                                <a href="http://www.zczyw.com/help/index/id/4">发起人协议</a>
                            </li>
                            <li> |</li>
                            <li>
                                <a href="http://www.zczyw.com/help/index/id/5">发起人须知</a>
                            </li>
                            <li> |</li>
                            <li>
                                <a href="http://www.zczyw.com/help/index/id/6">支持者须知</a>
                            </li>
                        </ul>
                        <p class="place_footer">--众筹中原-- by:神农山一队精英 </p>

                    </div>
                </div>
                <div class="trusted-icon">
                    <a href="http://www.51miit.com/auth/CE5B140C67E74642BB83A59AE27312EE/" target="_blank">
                        <img src="../../../images/icp.png" alt="">
                    </a>
                    <a href="http://www.zczyw.com/Public/statics/img/shangbiaozheng.jpg" target="_blank">
                        <img src="../../../images/shangbiaozheng.png" alt="">
                    </a>
                    <a href="http://www.zczyw.com/Public/statics/img/zhuzuoquan.jpg" target="_blank">
                        <img src="../../../images/zhuzuoquan.png" alt="">
                    </a>
                    <a href="http://gsxt.haaic.gov.cn/company/detail.jspx?id=4F8FFD5FE3C8896FE053070A080AC15D&amp;jyzk=jyzc" target="_blank">
                        <img src="../../../images/gongshang.png" alt="河南工商">
                    </a>
                    <a href="http://webscan.360.cn/index/checkwebsite/url/www.zczyw.com" target="_blank">
                        <img border="0" src="../../../images/360.png">
                    </a>
                    <a href="https://www.creditchina.gov.cn/xinyongxinxixiangqing/default.html?isEncryStr=1&amp;encryStr=fWJ3bjludDZpMjE%3D%0A&amp;name=%E6%B2%B3%E5%8D%97%E5%8D%8E%E6%99%9F%E7%BD%91%E7%BB%9C%E7%A7%91%E6%8A%80%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&amp;isEncryStr=1" target="_blank">
                        <img src="../../../images/china.png" alt="信用中国">
                    </a>
                </div>
            </div>
        </div>
    </div>
</footer>
<!-- 侧边栏 -->
<div class="side">

</div>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
<!-- 控制登录菜单 -->
<script type="text/javascript">
    var loginUser=${loginObject.userId};
    if (loginUser!=null){
        console.log(loginUser+"11");
        $("#loginBefore").css("display","none");
        $("#loginAfter").css("display","block");
    }else {
        console.log(loginUser);
        $("#loginAfter").css("display","none");
    }

    $('#head-img').hover(function() {
        $('#list').show();
    });
    $('.log_txt_head').mouseleave(function() {
        $("#list").css("display", "none");
    });
    $('#head-img').on('click', function() {
        window.location.href = "Site/toPerson.do";
    });
</script>
<!--控制新闻翻动-->
<script type="text/javascript">
    jQuery(".slideBox").slide({ mainCell: ".bd ul", autoPlay: true });
</script>
<script>
    jQuery(".txtScroll-top").slide({ titCell: ".hd ul", mainCell: ".bd ul", autoPage: true, effect: "top", autoPlay: true, vis: 1 });
</script>

<script type="text/javascript">
    //进页面加载数据
    var url = "/item/showItem";
    var count = 0;
    var limit = 5;
    var queryTime=0;
    //查询到的项目数据条数
    var loading=0;
    var num=5;
    <%--num=${itemListNum};--%>

    //滚动滑轮函数
    $(window).scroll(function() {
        //请求路径
        var url2= "/item/queryItem";

        //获取
        //当第一次加载时数据条数等于5时，继续滚动滑轮才继续加载，否则不再加载
                if (($(window).height() + $(window).scrollTop() + 130) >= $(document).height()) {
                    //num的赋值是通过itemTemplate页面来获取后台传来的值
                    if (num == 5){
                    console.log("上次获取到的数据条数--进入查询："+num);
                    if (loading == 1) return;
                    loading =1;
                    queryTime++;
                    count=queryTime*limit;
                    console.log("count:"+count);
                    $.post(url2,{
                    count : count,
                    limit : limit,
                    }, function(itemList) {
                        loading =0;
                        //通过后台返回模板页面来加载(itemTemplate)
                        $("#itemsList").append(itemList)
                });
                }else {
                        console.log("获取到的数据条数else："+num);
                    }
            }
    });




    $(function() {
        // $(window).scroll();
        $("span#s a").click(function() {
            var id = $(this).attr('id');
            $("#11").removeClass('active');
            $("#22").removeClass('active');
            $("#33").removeClass('active');
            $("#44").removeClass('active');
            $("#" + id).addClass('active');

            $('.team-list').text("");
            loading = 0;
            lastIndex = 1;
            left = id;
            $(window).scroll();
        });
        $("div#d a").click(function() {
            var id = $(this).attr('id');
            $("#1").removeClass('active');
            $("#2").removeClass('active');
            $("#3").removeClass('active');
            $("#" + id).addClass('active');

            $('.team-list').text("");
            loading = 0;
            lastIndex = 1;
            right = id;
            $(window).scroll();
        });
    });

/*    function todetail(id, target_amount, act_amount, remain_days) {
        $.get('showItems/onclickViews.do', {
            id : id
        }, function() {});
        window.location.href = 'http://www.zczyw.com:80/zczyPC/partTran/toPartTran.do?id=' + id;

    }*/
</script>

</body>

</html>